package com.cgs.query.demo

import com.cgs.query.service.IQueryService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/test")
@Api(description = "测试服务端服务")
open class TestController {

    @Autowired
    private lateinit var queryService: IQueryService

    @PostMapping("/{projectName}/{defineName}")
    @ApiOperation(value = "执行查询定义")
    fun execute(@ApiParam(value = "项目名称") @PathVariable projectName: String, @ApiParam(value = "定义名称") @PathVariable defineName: String, @ApiParam(value = "定义参数") @RequestBody param: Map<String, Any>): Any? {
        return queryService.execute(projectName, defineName, param, null)
    }
}